#include "app_runner.h"
#include <signal.h>

static int is_running = 1;

void exit_handler(int signo)
{   
   is_running = 0;
}
 
/**
 * @brief 运行程序
 */
void app_runner_run(void)
{
    // 注册接收中止信号的回调
    signal(SIGINT,exit_handler  ) ; // ctrl + c
    signal(SIGTERM,exit_handler) ;  //kill


    app_device_init(DEV_FILE_NAME);
    app_device_start();


    while(is_running)
    {
        sleep(1);
    }

    app_device_destroy();


}